package com.feifan.oa.service.impl;
import com.feifan.common.core.text.Convert;
import com.feifan.oa.domain.Face;
import com.feifan.oa.mapper.FaceMapper;
import com.feifan.oa.service.IFaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 人脸识别Service业务层处理
 *
 * @author 非凡
 * @date 2020-09-20
 */
@Service
public class FaceServiceImpl implements IFaceService
{
    @Autowired
    private FaceMapper faceMapper;

    /**
     * 查询人脸识别
     *
     * @param id 人脸识别ID
     * @return 人脸识别
     */
    @Override
    public Face selectFaceById(Long id)
    {
        return faceMapper.selectFaceById(id);
    }

    /**
     * 查询人脸识别列表
     *
     * @param face 人脸识别
     * @return 人脸识别
     */
    @Override
    public List<Face> selectFaceList(Face face)
    {
        return faceMapper.selectFaceList(face);
    }

    @Override
    public Face selectFaceByUID(Long uId) {
        return faceMapper.selectFaceByUID(uId);
    }

    /**
     * 新增人脸识别
     *
     * @param face 人脸识别
     * @return 结果
     */
    @Override
    public int insertFace(Face face)
    {
        return faceMapper.insertFace(face);
    }

    /**
     * 修改人脸识别
     *
     * @param face 人脸识别
     * @return 结果
     */
    @Override
    public int updateFace(Face face)
    {
        return faceMapper.updateFace(face);
    }

    /**
     * 删除人脸识别对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFaceByIds(String ids)
    {
        return faceMapper.deleteFaceByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除人脸识别信息
     *
     * @param id 人脸识别ID
     * @return 结果
     */
    @Override
    public int deleteFaceById(Long id)
    {
        return faceMapper.deleteFaceById(id);
    }
}
